package com.ruoyi.system.service.impl;

import java.util.List;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.SysLabelsMapper;
import com.ruoyi.system.domain.SysLabels;
import com.ruoyi.system.service.ISysLabelsService;

/**
 * 标签Service业务层处理
 *
 * @author king
 * @date 2022-07-15
 */
@Service
public class SysLabelsServiceImpl extends ServiceImpl<SysLabelsMapper,SysLabels> implements ISysLabelsService
{
    @Autowired
    private SysLabelsMapper sysLabelsMapper;

    /**
     * 查询标签
     *
     * @param id 标签主键
     * @return 标签
     */
    @Override
    public SysLabels selectSysLabelsById(Long id)
    {
        return sysLabelsMapper.selectSysLabelsById(id);
    }

    /**
     * 查询标签列表
     *
     * @param sysLabels 标签
     * @return 标签
     */
    @Override
    public List<SysLabels> selectSysLabelsList(SysLabels sysLabels)
    {
        return sysLabelsMapper.selectSysLabelsList(sysLabels);
    }

    /**
     * 新增标签
     *
     * @param sysLabels 标签
     * @return 结果
     */
    @Override
    public int insertSysLabels(SysLabels sysLabels)
    {
        sysLabels.setCreateTime(DateUtils.getNowDate());
        return sysLabelsMapper.insertSysLabels(sysLabels);
    }

    /**
     * 修改标签
     *
     * @param sysLabels 标签
     * @return 结果
     */
    @Override
    public int updateSysLabels(SysLabels sysLabels)
    {
        sysLabels.setUpdateTime(DateUtils.getNowDate());
        return sysLabelsMapper.updateSysLabels(sysLabels);
    }

    /**
     * 批量删除标签
     *
     * @param ids 需要删除的标签主键
     * @return 结果
     */
    @Override
    public int deleteSysLabelsByIds(Long[] ids)
    {
        return sysLabelsMapper.deleteSysLabelsByIds(ids);
    }

    /**
     * 删除标签信息
     *
     * @param id 标签主键
     * @return 结果
     */
    @Override
    public int deleteSysLabelsById(Long id)
    {
        return sysLabelsMapper.deleteSysLabelsById(id);
    }
}
